import 'package:flutter/material.dart';

/// 从一个远程包里加载字体
/// 1. 添加字体包
/// 2. 在pubspec.yaml添加配置
/// 3. 使用字体

class FontsApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Fonts Demo',
      theme: ThemeData(primarySwatch: Colors.red),
      home: Scaffold(
        appBar: AppBar(
          title: Text('Fonts Demo'),
        ),
        body: Center(
          child: Text(
            'Using the Raleway font from the font_awesome_flutter',
            style: TextStyle(
                fontFamily: 'fa',
                package: 'font_awesome_flutter',
                fontStyle: FontStyle.italic),
          ),
        ),
      ),
    );
  }
}
